function BattleSpecialBardWarsong()
{
CheckMp("Lv1.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  ReduceMp("Lv1.5");
  BattleSpecialBardWarSong2();
  }
}

function BattleSpecialBardWarSong2()
{
  Player.attack = (Player.str + Player.weaponeffect)*1.25
  if (Player2.pres == true)
  {
  Player2.attack = (Player2.str + Player2.weaponeffect)*1.25
  }
  if (Player3.pres == true)
  {
  Player3.attack = (Player3.str + Player3.weaponeffect)*1.25
  }  
  RenderMap();
  WindowStyle.drawWindow(5, 5, 235, 12);
  Font.drawText(7, 7, "War Song");
  BattleName(); 
  DrawPlayerStats();
  FlipScreen();
  Delay(1000);
BattleMenu_Itemused();
}

function BattleSpecialBardintimidate()
{
CheckMp("Lv2");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  ReduceMp("Lv2");
  BattleSpecialBardintimidate2();
  }
}

function BattleSpecialBardintimidate2()
{
  if (Monster1.hp > 0)
  {
  Monster1.attack = (Monster1.str)/1.25
  }
  if (Monster2.hp > 0)
  {
  Monster2.attack = (Monster2.str)/1.25
  }  
  if (Monster3.hp > 0)
  {
  Monster3.attack = (Monster3.str)/1.25
  }  
  if (Monster1.hp > 0)
  {
  Monster4.attack = (Monster4.str)/1.25
  }
  RenderMap();
  WindowStyle.drawWindow(5, 5, 235, 12);
  Font.drawText(7, 7, "Intimidate");
  BattleName(); 
  DrawPlayerStats();
  FlipScreen();
  Delay(1000);
BattleMenu_Itemused();

}

function BattleSpecialBardAnimals()
{
CheckMp("Lv2");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  ReduceMp("Lv2");
  Player.temp = "Animals";
  Player.techpower = 0.3;
  BattleSpecialBardSongAttack();
  }
}

function BattleSpecialBardResonance()
{
CheckMp("Lv2.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  ReduceMp("Lv2.5");
  Player.temp = "Resonance";
  Player.techpower = 2.9;
  BattleSpecialBardSongAttack();
  }
}

function BattleSpecialBardSongAttack()
{
Monster1.temppres = false;
Monster2.temppres = false;
Monster3.temppres = false;
Monster4.temppres = false;

  LoadFightStats();
  RenderMap();
  WindowStyle.drawWindow(5, 5, 235, 12);
  Font.drawText(7, 7, Player.temp);
  DrawPlayerStats();
  BattleName();
    if (Monster1.hp > 0)
    {
      Battle.math = Math.random()/5 + Player.techpower;
      Player.attackdamage = Math.floor(Player.atempstr*Player.atempstr*Battle.math/Monster1.defence*2);
      if (Player.temp == "Resonance")
      {
        if (Monster1.weak == "Earth")
        {
        Player.attackdamage = Player.attackdamage*1.5;  
        }
        if (Monster1.strong == "Earth")
        {
        Player.attackdamage = Player.attackdamage/2;  
        }
        if (Monster1.immune == "Earth")
        {
        Player.attackdamage = 0;  
        }
        if (Monster1.absorb == "Earth")
        {
        Player.attackdamage = Player.attackdamage*(0 - 1);  
        }
      }
    Monster1.hp = Monster1.hp - Player.attackdamage;
      if (Player.attackdamage < 0)
      {
      HpFont.drawTextBox (Monster1.posx, Monster1.posy, 500, 100, 5, Player.attackdamage*(0-1));
      }
      else
      {
      Font.drawTextBox (Monster1.posx, Monster1.posy, 500, 100, 5, Player.attackdamage);
      }
    Monster1.temppres = true;
    }
    if (Monster2.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage2 = Math.floor(Player.atempstr*Player.atempstr*Battle.math/Monster2.defence*2);
      if (Player.temp == "Resonance")
      {
        if (Monster2.weak == "Earth")
        {
        Player.attackdamage2 = Player.attackdamage2*1.5;  
        }
        if (Monster2.strong == "Earth")
        {
        Player.attackdamage2 = Player.attackdamage2/2;  
        }
        if (Monster2.immune == "Earth")
        {
        Player.attackdamage2 = 0;  
        }
        if (Monster2.absorb == "Earth")
        {
        Player.attackdamage2= Player.attackdamage2*(0 - 1);  
        }
      }

    Monster2.hp = Monster2.hp - Player.attackdamage2;
    if (Player.attackdamage2 < 0)
    {
    HpFont.drawTextBox (Monster2.posx, Monster2.posy, 500, 100, 5, Player.attackdamage2 * (0-1));    
    }
    else
    {
    Font.drawTextBox (Monster2.posx, Monster2.posy, 500, 100, 5, Player.attackdamage2)    
    }
    Monster2.temppres = true;
    }
    if (Monster3.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage3 = Math.floor(Player.atempstr*Player.atempstr*Battle.math/Monster3.defence*2)
      if (Player.temp == "Resonance")
      {
        if (Monster3.weak == "Earth")
        {
        Player.attackdamage3 = Player.attackdamage3*1.5;  
        }
        if (Monster3.strong == "Earth")
        {
        Player.attackdamage3 = Player.attackdamage3/2;  
        }
        if (Monster3.immune == "Earth")
        {
        Player.attackdamage3 = 0;  
        }
        if (Monster3.absorb == "Earth")
        {
        Player.attackdamage3 = Player.attackdamage3*(0 - 1);  
        }
      }
    Monster3.hp = Monster3.hp - Player.attackdamage3;
    if (Player.attackdamage3 < 0)
    {
    HpFont.drawTextBox (Monster3.posx, Monster3.posy, 500, 100, 5, Player.attackdamage3*(0-1));    
    }
    else
    {
    Font.drawTextBox (Monster3.posx, Monster3.posy, 500, 100, 5, Player.attackdamage3);    
    }
    Monster3.temppres = true;
    }
    if (Monster4.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage4 = Math.floor(Player.atempstr*Player.atempstr*Battle.math/Monster4.defence*2);
      if (Player.temp == "Resonance")
      {
        if (Monster4.weak == "Earth")
        {
        Player.attackdamage4 = Player.attackdamage4*1.5;  
        }
        if (Monster4.strong == "Earth")
        {
        Player.attackdamage4 = Player.attackdamage4/2;  
        }
        if (Monster4.immune == "Earth")
        {
        Player.attackdamage4 = 0;  
        }
        if (Monster4.absorb == "Earth")
        {
        Player.attackdamage4 = Player.attackdamage4*(0 - 1);  
        }
      }
    Monster4.hp = Monster4.hp - Player.attackdamage4;
    if (Player.attackdamage4 < 0)
    {
    HpFont.drawTextBox (Monster4.posx, Monster4.posy, 500, 100, 5, Player.attackdamage4*(0-1));    
    }
    else
    {
    Font.drawTextBox (Monster4.posx, Monster4.posy, 500, 100, 5, Player.attackdamage4);    
    }
    Monster4.temppres = true;
    }
    FlipScreen();
    Delay(1000);
    if (Monster1.temppres == true)
    {
      if (Monster1.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster1");
      }
    }
    if (Monster2.temppres == true)
    {
      if (Monster2.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster2");
      }
    }
    if (Monster3.temppres == true)
    {
      if (Monster3.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster3");
      }
    }
    if (Monster4.temppres == true)
    {
      if (Monster4.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster4");
      }
    }
  Delay(400);
  RenderMap();
  BattleMenu_Itemused();
}
function BattleSpecialRangerPeep()
{
Player.BMenuTemp = true;
RenderMap();
  BattleName(); 
  DrawPlayerStats();
  var BattleMenuItem = new BMenu();
  BattleMenuItem.font         = Font;
  BattleMenuItem.window_style = WindowStyle;
  BattleMenuItem.arrow        = Arrow;
  if (Monster1.hp > 0)
  {
  BattleMenuItem.addItem(Monster1.name, BattleSpecialRangerPeepT1);
  }
  if (Monster2.hp > 0)
  {
  BattleMenuItem.addItem(Monster2.name, BattleSpecialRangerPeepT2);
  }
  if (Monster3.hp > 0)
  {
  BattleMenuItem.addItem(Monster3.name, BattleSpecialRangerPeepT3);
  }
  if (Monster4.hp > 0)
  {
  BattleMenuItem.addItem(Monster4.name, BattleSpecialRangerPeepT4);
  }

  BattleMenuItem.addItem("Cancel", GoToActivePlayer);  
  BattleMenuItem.execute(5, 355, 235, 120);
}
function BattleSpecialRangerPeepT1()
{
  RenderMap() 
  WindowStyle.drawWindow (25, 380, 590, 80);//25, 330, 590, 130
  Font.drawTextBox (75, 400, 525, 60, 5, Monster1.name + " - Hp: " + Monster1.hp + "/" + Monster1.maxhp + " Mp: " + Monster1.mp + "/" + Monster1.maxmp);//75, 380, 525, 100, 5
  Font.drawTextBox (75, 410, 525, 60, 5, "Weakness: " + Monster1.weak + " Resistant: " + Monster1.strong + " Immune: " + Monster1.immune + " Absorb: " + Monster1.absorb);//75, 380, 525, 100, 5
  FlipScreen();
  eatKey()
  while (IsKeyPressed(KEY_SPACE) == false) 
  {Delay(100);}
  {GetKey()}
  BattleMenu_Itemused();
}
function BattleSpecialRangerPeepT2()
{
  RenderMap() 
  WindowStyle.drawWindow (25, 380, 590, 80);//25, 330, 590, 130
  Font.drawTextBox (75, 400, 525, 60, 5, Monster2.name + " - Hp: " + Monster2.hp + "/" + Monster2.maxhp + " Mp: " + Monster2.mp + "/" + Monster2.maxmp);//75, 380, 525, 100, 5
  Font.drawTextBox (75, 410, 525, 60, 5, "Weakness: " + Monster2.weak + " Resistant: " + Monster2.strong + " Immune: " + Monster2.immune + " Absorb: " + Monster2.absorb);//75, 380, 525, 100, 5
  FlipScreen();
  eatKey()
  while (IsKeyPressed(KEY_SPACE) == false) 
  {Delay(100);}
  {GetKey()}
  BattleMenu_Itemused();
}
function BattleSpecialRangerPeepT3()
{
  RenderMap() 
  WindowStyle.drawWindow (25, 380, 590, 80);//25, 330, 590, 130
  Font.drawTextBox (75, 400, 525, 60, 5, Monster3.name + " - Hp: " + Monster3.hp + "/" + Monster3.maxhp + " Mp: " + Monster3.mp + "/" + Monster3.maxmp);//75, 380, 525, 100, 5
  Font.drawTextBox (75, 410, 525, 60, 5, "Weakness: " + Monster3.weak + " Resistant: " + Monster3.strong + " Immune: " + Monster3.immune + " Absorb: " + Monster3.absorb);//75, 380, 525, 100, 5
  FlipScreen();
  eatKey()
  while (IsKeyPressed(KEY_SPACE) == false) 
  {Delay(100);}
  {GetKey()}
  BattleMenu_Itemused();
}
function BattleSpecialRangerPeepT4()
{
  RenderMap() 
  WindowStyle.drawWindow (25, 380, 590, 80);//25, 330, 590, 130
  Font.drawTextBox (75, 400, 525, 60, 5, Monster4.name + " - Hp: " + Monster4.hp + "/" + Monster4.maxhp + " Mp: " + Monster4.mp + "/" + Monster4.maxmp);//75, 380, 525, 100, 5
  Font.drawTextBox (75, 410, 525, 60, 5, "Weakness: " + Monster4.weak + " Resistant: " + Monster4.strong + " Immune: " + Monster4.immune + " Absorb: " + Monster4.absorb);//75, 380, 525, 100, 5
  FlipScreen();
  eatKey()
  while (IsKeyPressed(KEY_SPACE) == false) 
  {Delay(100);}
  {GetKey()}
  BattleMenu_Itemused();
}
